/**
 * <copyright>
 * </copyright>
 *

 */
package hu.bme.mit.androtext.age.age.impl;

import hu.bme.mit.androtext.age.age.AgeFactory;
import hu.bme.mit.androtext.age.age.AgePackage;
import hu.bme.mit.androtext.age.age.AndroidApplication;
import hu.bme.mit.androtext.age.age.PlainString;
import hu.bme.mit.androtext.age.age.StringLiteral;

import hu.bme.mit.androtext.data.androData.AndroDataPackage;

import hu.bme.mit.androtext.nav.androNav.AndroNavPackage;

import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;

import org.eclipse.emf.ecore.impl.EPackageImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Package</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class AgePackageImpl extends EPackageImpl implements AgePackage
{
  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass androidApplicationEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass stringLiteralEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass plainStringEClass = null;

  /**
   * Creates an instance of the model <b>Package</b>, registered with
   * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
   * package URI value.
   * <p>Note: the correct way to create the package is via the static
   * factory method {@link #init init()}, which also performs
   * initialization of the package, or returns the registered package,
   * if one already exists.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see org.eclipse.emf.ecore.EPackage.Registry
   * @see hu.bme.mit.androtext.age.age.AgePackage#eNS_URI
   * @see #init()
   * @generated
   */
  private AgePackageImpl()
  {
    super(eNS_URI, AgeFactory.eINSTANCE);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private static boolean isInited = false;

  /**
   * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
   * 
   * <p>This method is used to initialize {@link AgePackage#eINSTANCE} when that field is accessed.
   * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #eNS_URI
   * @see #createPackageContents()
   * @see #initializePackageContents()
   * @generated
   */
  public static AgePackage init()
  {
    if (isInited) return (AgePackage)EPackage.Registry.INSTANCE.getEPackage(AgePackage.eNS_URI);

    // Obtain or create and register package
    AgePackageImpl theAgePackage = (AgePackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof AgePackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new AgePackageImpl());

    isInited = true;

    // Initialize simple dependencies
    AndroDataPackage.eINSTANCE.eClass();
    AndroNavPackage.eINSTANCE.eClass();

    // Create package meta-data objects
    theAgePackage.createPackageContents();

    // Initialize created meta-data
    theAgePackage.initializePackageContents();

    // Mark meta-data to indicate it can't be changed
    theAgePackage.freeze();

  
    // Update the registry and return the package
    EPackage.Registry.INSTANCE.put(AgePackage.eNS_URI, theAgePackage);
    return theAgePackage;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getAndroidApplication()
  {
    return androidApplicationEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getAndroidApplication_ApplicationName()
  {
    return (EAttribute)androidApplicationEClass.getEStructuralFeatures().get(0);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getAndroidApplication_ProjectName()
  {
    return (EAttribute)androidApplicationEClass.getEStructuralFeatures().get(1);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getAndroidApplication_PackageName()
  {
    return (EAttribute)androidApplicationEClass.getEStructuralFeatures().get(2);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EReference getAndroidApplication_Data()
  {
    return (EReference)androidApplicationEClass.getEStructuralFeatures().get(3);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EReference getAndroidApplication_Ui()
  {
    return (EReference)androidApplicationEClass.getEStructuralFeatures().get(4);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getStringLiteral()
  {
    return stringLiteralEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getStringLiteral_Begin()
  {
    return (EAttribute)stringLiteralEClass.getEStructuralFeatures().get(0);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EReference getStringLiteral_Parts()
  {
    return (EReference)stringLiteralEClass.getEStructuralFeatures().get(1);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getStringLiteral_End()
  {
    return (EAttribute)stringLiteralEClass.getEStructuralFeatures().get(2);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getPlainString()
  {
    return plainStringEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getPlainString_Value()
  {
    return (EAttribute)plainStringEClass.getEStructuralFeatures().get(0);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public AgeFactory getAgeFactory()
  {
    return (AgeFactory)getEFactoryInstance();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private boolean isCreated = false;

  /**
   * Creates the meta-model objects for the package.  This method is
   * guarded to have no affect on any invocation but its first.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void createPackageContents()
  {
    if (isCreated) return;
    isCreated = true;

    // Create classes and their features
    androidApplicationEClass = createEClass(ANDROID_APPLICATION);
    createEAttribute(androidApplicationEClass, ANDROID_APPLICATION__APPLICATION_NAME);
    createEAttribute(androidApplicationEClass, ANDROID_APPLICATION__PROJECT_NAME);
    createEAttribute(androidApplicationEClass, ANDROID_APPLICATION__PACKAGE_NAME);
    createEReference(androidApplicationEClass, ANDROID_APPLICATION__DATA);
    createEReference(androidApplicationEClass, ANDROID_APPLICATION__UI);

    stringLiteralEClass = createEClass(STRING_LITERAL);
    createEAttribute(stringLiteralEClass, STRING_LITERAL__BEGIN);
    createEReference(stringLiteralEClass, STRING_LITERAL__PARTS);
    createEAttribute(stringLiteralEClass, STRING_LITERAL__END);

    plainStringEClass = createEClass(PLAIN_STRING);
    createEAttribute(plainStringEClass, PLAIN_STRING__VALUE);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private boolean isInitialized = false;

  /**
   * Complete the initialization of the package and its meta-model.  This
   * method is guarded to have no affect on any invocation but its first.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void initializePackageContents()
  {
    if (isInitialized) return;
    isInitialized = true;

    // Initialize package
    setName(eNAME);
    setNsPrefix(eNS_PREFIX);
    setNsURI(eNS_URI);

    // Obtain other dependent packages
    AndroDataPackage theAndroDataPackage = (AndroDataPackage)EPackage.Registry.INSTANCE.getEPackage(AndroDataPackage.eNS_URI);
    AndroNavPackage theAndroNavPackage = (AndroNavPackage)EPackage.Registry.INSTANCE.getEPackage(AndroNavPackage.eNS_URI);

    // Create type parameters

    // Set bounds for type parameters

    // Add supertypes to classes

    // Initialize classes and features; add operations and parameters
    initEClass(androidApplicationEClass, AndroidApplication.class, "AndroidApplication", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEAttribute(getAndroidApplication_ApplicationName(), ecorePackage.getEString(), "applicationName", null, 0, 1, AndroidApplication.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getAndroidApplication_ProjectName(), ecorePackage.getEString(), "projectName", null, 0, 1, AndroidApplication.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getAndroidApplication_PackageName(), ecorePackage.getEString(), "packageName", null, 0, 1, AndroidApplication.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getAndroidApplication_Data(), theAndroDataPackage.getAndroDataRoot(), null, "data", null, 0, 1, AndroidApplication.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getAndroidApplication_Ui(), theAndroNavPackage.getAndroNavRoot(), null, "ui", null, 0, 1, AndroidApplication.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

    initEClass(stringLiteralEClass, StringLiteral.class, "StringLiteral", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEAttribute(getStringLiteral_Begin(), ecorePackage.getEString(), "begin", null, 0, 1, StringLiteral.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getStringLiteral_Parts(), this.getPlainString(), null, "parts", null, 0, -1, StringLiteral.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getStringLiteral_End(), ecorePackage.getEString(), "end", null, 0, 1, StringLiteral.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

    initEClass(plainStringEClass, PlainString.class, "PlainString", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEAttribute(getPlainString_Value(), ecorePackage.getEString(), "value", null, 0, 1, PlainString.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

    // Create resource
    createResource(eNS_URI);
  }

} //AgePackageImpl
